package org.asiainfo.system.dubbo;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.asiainfo.common.core.utils.MapstructUtils;
import org.asiainfo.system.api.RemoteClientService;
import org.asiainfo.system.api.domain.vo.RemoteClientVo;
import org.asiainfo.system.domain.vo.SysClientVo;
import org.asiainfo.system.service.SysClientService;
import org.springframework.stereotype.Service;

/**
 * 客户端服务
 *
 * @author dotor-ww
 */
@Service
@DubboService
@RequiredArgsConstructor
@Slf4j
public class RemoteClientServiceImpl implements RemoteClientService {

    private final SysClientService sysClientService;

    /**
     * 根据客户端id查询客户端信息
     *
     * @param clientId 客户端id
     * @return 查询结果
     */
    @Override
    public RemoteClientVo queryByClientId(String clientId) {
        SysClientVo sysClientVo = sysClientService.queryByClientId(clientId);
        return MapstructUtils.convert(sysClientVo, RemoteClientVo.class);
    }
}
